package day6;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class ArraySearch3 {
    public static void main(String[] args) {
        int[] ar = {8, 4, 14, 22, 23, 76, 25, 3, 19};
        Scanner in = new Scanner(System.in);
        System.out.print("请输入要查找的数字:");
        int k = in.nextInt();
        //boolean isIn = false;//假定不在！
        for (int i = 0; i < ar.length; i++) {
            if (ar[i] == k) {
                System.out.println("k在这个数组中！");
                break;
            }else if(i==ar.length-1){
                System.out.println("k不在数组中！");
            }
        }

    }
}
